package hu.fic.weddingstorefinder.parcel;

import hu.fic.weddingstorefinder.db.table.POI;
import android.os.Parcel;
import android.os.Parcelable;

public class StoreParcelable implements Parcelable {
	
	private int customPoiId;
	private int poiStatus;
	private double longitude;
	private double latitude;
	private String address;
	private String city;
	private String phone;
	private String poiName;
	private String zipCode;
	private double distanceFromCurrentLocation;
	
	public StoreParcelable(Parcel in) {
		this.customPoiId = in.readInt();
		this.poiStatus = in.readInt();
		this.longitude = in.readDouble();
		this.latitude = in.readDouble();
		this.address = in.readString();
		this.city = in.readString();
		this.phone = in.readString();
		this.poiName = in.readString();
		this.zipCode = in.readString();
	}
	
	public StoreParcelable(POI poi) {
		this.customPoiId = poi.getCustomPOIId();
		this.poiStatus = poi.getPOIStatus();
		this.longitude = poi.getLongitude();
		this.latitude =poi.getLatitude();
		this.address = poi.getAddress();
		this.city = poi.getCity();
		this.phone = poi.getPhone();
		this.poiName = poi.getPOIName();
		this.zipCode = poi.getZIPCode();
	}
	
	public StoreParcelable () {
		
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel parcel, int flags) {
		parcel.writeInt(this.customPoiId);
		parcel.writeInt(this.poiStatus);
		parcel.writeDouble(this.longitude);
		parcel.writeDouble(this.latitude);
		parcel.writeString(address);
		parcel.writeString(city);
		parcel.writeString(phone);
		parcel.writeString(poiName);
		parcel.writeString(zipCode);
	}
	
	public static final Parcelable.Creator<StoreParcelable> CREATOR = new Parcelable.Creator<StoreParcelable>() {
		 public StoreParcelable createFromParcel(Parcel in) {
		     return new StoreParcelable(in);
		 }
		
		 public StoreParcelable[] newArray(int size) {
		     return new StoreParcelable[size];
		 }
	};

	public int getCustomPoiId() {
		return customPoiId;
	}

	public void setCustomPoiId(int customPoiId) {
		this.customPoiId = customPoiId;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPoiName() {
		return poiName;
	}

	public void setPoiName(String poiName) {
		this.poiName = poiName;
	}

	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	public int getPoiStatus() {
		return poiStatus;
	}

	public void setPoiStatus(int poiStatus) {
		this.poiStatus = poiStatus;
	}

	public double getDistanceFromCurrentLocation() {
		return distanceFromCurrentLocation;
	}

	public void setDistanceFromCurrentLocation(double distanceFromCurrentLocation) {
		this.distanceFromCurrentLocation = distanceFromCurrentLocation;
	}
	

}
